package com.zyz.G_常用类.字符串;

/**
 * @author: vick
 * @Date: 2025/3/19
 * @Description:
 * @version: 1.0
 */
public class Demo {
    public static void main(String[] args) {
        //采用字面量的方式创建字符串，存储到  字符串常量池中
        String str1 = "vick";
        String str2 = "vick";
        System.out.println(str1 == str2);//true

        str1 = "aaa";
        System.out.println(str1 == str2);//false
        System.out.println(str1);
        System.out.println(str2);

        System.out.println("==================");

        String str3 = "abc";
        str3 += "def";
        System.out.println(str3);


        System.out.println("===============");
        String str4 = "123";
        String str5 = str4.replace("1", "v");
        System.out.println(str4);
        System.out.println(str5);


    }
}
